<?php include TMPL_PATH.'public/header.phtml';?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	<div style="float:left;margin-right:50px;">
        <a href='javascript:;' class="on"><em>电话咨询列表</em></a>
      </div>
    	<div style="color:#000;">
    		<form name="searchform" action="__SELF__"  method="post">
    		<input type="hidden" value="1" name="search">
    		问题类型：<select name="model_id" >
    			<option>-全部-</option>
    			<?php 
    				$category = CategoryModel::getCategoryList(6);
    				foreach ($category as $tk):
    			?>
    			<option value="<?php echo $tk['id']; ?>"><?php echo $tk['name'];?></option>
    			<?php endforeach;?>
    		</select>&nbsp;&nbsp;&nbsp;
				订单号 <input type="text" class="input-text" name="order_sn">
				<input type="submit" value="搜索" class="button" name="search">
    		</form>
    	</div>
    </div>
</div>
<div class="bk"></div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th width="30">ID</th>
            <th align='center' width="60">问题类型</th>
            <th align='center'>内容</th>
            <th align='center' width="100">订单号</th>
            <th align='center' width="100">手机号</th>
            <th align='center' width="100">固话</th>
            <th align='center' width="80">语言</th>
			<th align='center' width="100">预约时间</th>
			<th align='center' width="100">添加时间</th>
            <th align='center' width="80">状态</th>
			<th align='center' width="100">操作</th>
            </tr>
        </thead>
    <tbody>
    <?php 
   	if(isset($orderphoneList) && $orderphoneList):
   		foreach ($orderphoneList as $v):
   ?>
			<tr>
					<td align='center'><?php echo $v['id']?></td>
					<td align='center'><?php $category = CategoryModel::getCategoryInfo($v['model_id']); echo $category['name'];?></td>
					<td>
						<?php 
							//if(strlen($v['content'])>50){
	                        //    echo substr($v['content'],0,50).'...';
							//}else if(!empty($v['content'])){ 
								echo $v['content']; 
							//}
						?>
					</td>
					<td align='center'><?php echo $v['order_sn']?></td>
					<td align='center'><?php echo $v['mobile'];?></td>
					<td align='center'><?php echo $v['phone'];?></td>
					<td align='center'><?php echo $v['language'];?></td>
					<td align='center'><?php echo date('Y-m-d H:i:s',$v['yuyue_time']);?></td>
					<td align='center'><?php echo date('Y-m-d H:i:s',$v['time']);?></td>
					<td align='center' id="status-<?php echo $v['id']?>">
					<?php if($v['disabled']):?>
					<a href="javascript:setting_status(<?php echo $v['id']?>,0);"><font color="red">√</font></a>
					<?php else:?>
					<a href="javascript:setting_status(<?php echo $v['id']?>,1);"><font color="blue">×</font></a>
					<?php endif;?>
					</td>
					<td align='center'>
					<a id="disabled-<?php echo $v['id'];?>" href="<?php echo U('comment/order_phone_info', 'id='.$v['id']);?>"><?php if($v['disabled']){echo "已处理";}else{ echo "未处理";}?></a> | 
					<a href="javascript:confirmurl('<?php echo U('comment/order_phone_delete', 'id='.$v['id']);?>','确认要删除 该预约咨询 吗？')">删除</a>
					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>

<div id="pages"><?php echo $pageShow;?></div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
function setting_status(id,disabled){
	$.get('<?php echo U('comment/change_order_phone_ajax');?>&comid='+id+'&disabled='+disabled,function(){
			if(disabled==0){
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',1);"><font color="blue">×</font></a>');
				$('#disabled-'+id).html('未处理');
			}else{
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',0);"><font color="red">√</font></a>');
				$('#disabled-'+id).html('已处理');
			}
		});
}
//-->
</script>